

<%@ page import="hc.uco.Riscos" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'riscos.label', default: 'Riscos')}" />
        <g:set var="RiscoPontosCrusade" value="${1}" />
        <g:set var="RiscoPorcentCrusade" value="${0}" />
        <g:set var="RiscoPontosTimi" value="${0}" />
        <g:set var="Risco14diasTimi" value="${0}" />
        <g:set var="RiscoPontosTimiComSupra" value="${0}" />
        <g:set var="Risco30diasTimi" value="${0}" />
        <g:set var="SomaFatores" value="${0}" />
        <g:set var="SomaFatoresTimiComSupra" value="${0}" />
        <g:set var="RiscoGFR" value="${0}" />
        <g:set var="RiscoIdade" value="${pacienteInstance?.idade}" />
        
        <g:set var="RiscoDiagnosticoAdmissao" value="${pacienteInstance?.diagnosticoAdmissao}" />
        
        <g:set var="RiscoTabagista" value="${pacienteInstance.historiaPregressa?.tabagista}" />
        <g:set var="RiscoHas" value="${pacienteInstance.historiaPregressa?.has}" />
        <g:set var="RiscoHistFamiliar" value="${pacienteInstance.historiaPregressa?.histFamiliar}" />
        
        <g:set var="RiscoDmi" value="${pacienteInstance.historiaPregressa?.dmi}" />
        <g:set var="RiscoDmii" value="${pacienteInstance.historiaPregressa?.dmii}" />
        
        <g:set var="RiscoIam" value="${pacienteInstance.historiaPregressa?.iam}" />
        <g:set var="RiscoAngioplastia" value="${pacienteInstance.historiaPregressa?.angioplastia}" />
        <g:set var="RiscoRvm" value="${pacienteInstance.historiaPregressa?.rvm}" />
        <g:set var="RiscoCateEstenose" value="${pacienteInstance.historiaPregressa?.cateEstenose}" />
        <g:set var="RiscoAnginaEstavel" value="${pacienteInstance.historiaPregressa?.anginaEstavel}" />
        
        <g:set var="RiscoInfra" value="${pacienteInstance.historiaPregressa?.alteracaoInfra}" />
        <g:set var="RiscoInversao" value="${pacienteInstance.historiaPregressa?.alteracaoInversao}" />
        <g:set var="RiscoDelta" value="${pacienteInstance.historiaPregressa?.alteracaoDelta}" />
        <g:set var="RiscoDAP" value="${pacienteInstance.historiaPregressa?.dap}" />
        
        <g:set var="RiscoUsoAAS" value="${pacienteInstance?.usoAAS}" />
        
        <g:set var="RiscoAngina24horas" value="${pacienteInstance?.angina24horas}" />
        
        <g:set var="RiscoCkmb" value="${pacienteInstance.examesAdmissao?.ckmb}" />
        <g:set var="RiscoTroponina" value="${pacienteInstance.examesAdmissao?.troponina}" />
        <g:set var="RiscoHdl" value="${pacienteInstance.examesAdmissao?.hdl}" />
        <g:set var="RiscoHematocrito" value="${pacienteInstance.examesAdmissao?.hematocrito}" />
        <g:set var="RiscoCreatinina" value="${pacienteInstance.examesAdmissao?.creatinina}" />
        
        <g:set var="RiscoPAS" value="${pacienteInstance?.paS}" />
        <g:set var="RiscoFC" value="${pacienteInstance?.fc}" />
        <g:set var="RiscoKillip" value="${pacienteInstance?.killip}" />
        <g:set var="RiscoPeso" value="${pacienteInstance?.peso}" />
        <g:set var="RiscoIAManterior" value="${pacienteInstance?.iamAnterior}" />
        <g:set var="RiscoGenero" value="${pacienteInstance?.genero}" />
        <g:set var="RiscoKillip" value="${pacienteInstance?.killip}" />
        
        <g:set var="RiscoBloqueio" value="${pacienteInstance.historiaPregressa?.bloqueio}" />
        <g:set var="RiscoDelta" value="${pacienteInstance.historiaPregressa?.deltaT}" />
        
        <title><g:message code="default.show.label" args="[entityName]" /></title>
    </head>
    <body>
        <g:render template="/mainbar" />
        <div class="body">
            <h1>Paciente: ${fieldValue(bean: pacienteInstance, field: "nome")}</h1>
            <g:render template="/pacientebar" />
            <div class="dialog">
                <g:render template="/pacienteheader" />
             </div>
             <g:if test="${flash.message}"><div class="message">${flash.message}</div></g:if>
	            <g:hasErrors bean="${riscosInstance}">
	            <div class="errors">
	                <g:renderErrors bean="${riscosInstance}" as="list" />
	            </div>
            	</g:hasErrors>
            	<g:if test="${flash.errors}">
            	<div class="errors">
	                <g:renderErrors bean="${flash}" as="list" />
	            </div></g:if>
            <g:form method="post" >
                <g:hiddenField name="id" value="${riscosInstance?.id}" />
                <g:hiddenField name="version" value="${riscosInstance?.version}" />
                <g:hiddenField name="paciente.id" value="${pacienteInstance?.id}" />
                <div class="dialog">
                	<h2><g:message code="riscos.tit.im" /></h2><span></span>
                    <table>
                        <tbody>
                            <tr class="prop">
                                <th valign="top">Escores</th>
                                <th valign="top">Pontos</th>
                                <th valign="top">% - 14 dias</th>
                                <th valign="top">% - 30 dias</th>
                                <th valign="top">% - 6 meses</th>
                            </tr>
                            
                        	<g:if test="${RiscoDiagnosticoAdmissao.equals('IAM SSST') || RiscoDiagnosticoAdmissao.equals('Angina Instável') }" >
                        		<g:if test="${RiscoTabagista == [true]}" ><g:set var="SomaFatores" value="${SomaFatores + 1}" /></g:if>
                        		<g:if test="${RiscoHas == [true]}" ><g:set var="SomaFatores" value="${SomaFatores + 1}" /></g:if>
                        		<g:if test="${RiscoHistFamiliar == [true]}" ><g:set var="SomaFatores" value="${SomaFatores + 1}" /></g:if>
                        		<g:if test="${RiscoHdl[0] < 40}" ><g:set var="SomaFatores" value="${SomaFatores + 1}" /></g:if>
                        		<g:if test="${RiscoIdade >= 65}" ><g:set var="RiscoPontosTimi" value="${RiscoPontosTimi + 1}" /></g:if>
                        		<g:if test="${(RiscoDmi == [true] || RiscoDmii == [true]) || (SomaFatores >= 3)}" ><g:set var="RiscoPontosTimi" value="${RiscoPontosTimi + 1}" /></g:if>
                        		<g:if test="${RiscoIam == [true] || RiscoAngioplastia == [true] || RiscoRvm == [true] || RiscoCateEstenose == [true] || RiscoAnginaEstavel == [true]}" ><g:set var="RiscoPontosTimi" value="${RiscoPontosTimi + 1}" /></g:if>
                        		<g:if test="${RiscoInfra == [true] || RiscoInversao == [true] || RiscoDelta == [true]}" ><g:set var="RiscoPontosTimi" value="${RiscoPontosTimi + 1}" /></g:if>
                        		<g:if test="${RiscoUsoAAS == true}" ><g:set var="RiscoPontosTimi" value="${RiscoPontosTimi + 1}" /></g:if>
                        		<g:if test="${RiscoAngina24horas == true}" ><g:set var="RiscoPontosTimi" value="${RiscoPontosTimi + 1}" /></g:if>
                        		<g:if test="${RiscoCkmb[0] > 25 || RiscoTroponina[0] > 0.100001}" ><g:set var="RiscoPontosTimi" value="${RiscoPontosTimi + 1}" /></g:if>
	                            <tr class="prop">
	                                <td valign="top" class="name" >
	                                  <label for="timiPontos"><g:message code="riscos.timiSemSupraPontos.label" default="TIMI Sem Supra (Mortalidade total, infarto novo ou recorrente, ou vascularização de urgência por isquemia)" /></label>
	                                </td>
	                                <td valign="top" class="value ${hasErrors(bean: riscosInstance, field: 'timiSemSupraPontos', 'errors')}">
	                                	<g:textField name="timiSemSupraPontos" value="${RiscoPontosTimi}" />
	                                </td>
	                                <g:if test="${RiscoPontosTimi == 1}" ><g:set var="Risco14diasTimi" value="${5}" /></g:if>
	                                <g:if test="${RiscoPontosTimi == 2}" ><g:set var="Risco14diasTimi" value="${8}" /></g:if>
	                                <g:if test="${RiscoPontosTimi == 3}" ><g:set var="Risco14diasTimi" value="${13}" /></g:if>
	                                <g:if test="${RiscoPontosTimi == 4}" ><g:set var="Risco14diasTimi" value="${20}" /></g:if>
	                                <g:if test="${RiscoPontosTimi == 5}" ><g:set var="Risco14diasTimi" value="${26}" /></g:if>
	                                <g:if test="${RiscoPontosTimi == 6 || RiscoPontosTimi == 7}" ><g:set var="Risco14diasTimi" value="${41}" /></g:if>
	                                <td valign="top" class="value ${hasErrors(bean: riscosInstance, field: 'timiSemSupra14dias', 'errors')}">
	                                    <g:textField name="timiSemSupra14dias" value="${Risco14diasTimi}" />
	                                </td>
	                            </tr>
	                     	</g:if>
	                     	
	                     	<g:else>
	                     		<g:if test="${RiscoIdade >= 65 && RiscoIdade < 75}" ><g:set var="RiscoPontosTimiComSupra" value="${RiscoPontosTimiComSupra + 2}" /></g:if>
	                     		<g:if test="${RiscoIdade >= 75}" ><g:set var="RiscoPontosTimiComSupra" value="${RiscoPontosTimiComSupra + 3}" /></g:if>
	                     		<g:if test="${RiscoDmi == [true] || RiscoDmii == [true] || RiscoHas == [true] || RiscoAnginaEstavel == [true]}" ><g:set var="RiscoPontosTimiComSupra" value="${RiscoPontosTimiComSupra + 1}" /></g:if>
	                     		<g:if test="${RiscoPAS < 100}" ><g:set var="RiscoPontosTimiComSupra" value="${RiscoPontosTimiComSupra + 3}" /></g:if>
	                     		<g:if test="${RiscoFC > 100}" ><g:set var="RiscoPontosTimiComSupra" value="${RiscoPontosTimiComSupra + 2}" /></g:if>
	                     		<g:if test="${RiscoKillip > 1}" ><g:set var="RiscoPontosTimiComSupra" value="${RiscoPontosTimiComSupra + 2}" /></g:if>
	                     		<g:if test="${RiscoPeso < 67}" ><g:set var="RiscoPontosTimiComSupra" value="${RiscoPontosTimiComSupra + 1}" /></g:if>
	                     		<g:if test="${RiscoIAManterior == true || RiscoBloqueio[0].equals('De ramo Esquerdo')}" ><g:set var="RiscoPontosTimiComSupra" value="${RiscoPontosTimiComSupra + 1}" /></g:if>
	                     		<g:if test="${RiscoDelta[0] > 4}" ><g:set var="RiscoPontosTimiComSupra" value="${RiscoPontosTimiComSupra + 1}" /></g:if>
								<tr class="prop">
	                                <td valign="top" class="name">
	                                  <label for="timiPontos"><g:message code="riscos.timiComSupraPontos.label" default="TIMI Com Supra (Mortalidade total)" /></label>
	                                </td>
	                                <td valign="top" class="value ${hasErrors(bean: riscosInstance, field: 'timiComSupraPontos', 'errors')}">
	                                	<g:textField name="timiComSupraPontos" value="${RiscoPontosTimiComSupra}" />
	                                </td>
	                                <td></td>
	                                <g:if test="${RiscoPontosTimiComSupra == 0}" ><g:set var="Risco30diasTimi" value="${0.8}" /></g:if>
	                                <g:if test="${RiscoPontosTimiComSupra == 1}" ><g:set var="Risco30diasTimi" value="${1.6}" /></g:if>
	                                <g:if test="${RiscoPontosTimiComSupra == 2}" ><g:set var="Risco30diasTimi" value="${2.2}" /></g:if>
	                                <g:if test="${RiscoPontosTimiComSupra == 3}" ><g:set var="Risco30diasTimi" value="${4.4}" /></g:if>
	                                <g:if test="${RiscoPontosTimiComSupra == 4}" ><g:set var="Risco30diasTimi" value="${7.3}" /></g:if>
	                                <g:if test="${RiscoPontosTimiComSupra == 5}" ><g:set var="Risco30diasTimi" value="${12.4}" /></g:if>
	                                <g:if test="${RiscoPontosTimiComSupra == 6}" ><g:set var="Risco30diasTimi" value="${16.1}" /></g:if>
	                                <g:if test="${RiscoPontosTimiComSupra == 7}" ><g:set var="Risco30diasTimi" value="${23.4}" /></g:if>
	                                <g:if test="${RiscoPontosTimiComSupra == 8}" ><g:set var="Risco30diasTimi" value="${26.8}" /></g:if>
	                                <g:if test="${RiscoPontosTimiComSupra >= 9}" ><g:set var="Risco30diasTimi" value="${35.9}" /></g:if>
	                                <td valign="top" class="value ${hasErrors(bean: riscosInstance, field: 'timiComSupra30dias', 'errors')}">
	                                    <g:textField name="timiComSupra30dias" value="${Risco30diasTimi}" />
	                                </td>
	                            </tr>	                     	
	                     	</g:else>
	                	</tbody>
                    </table>     	
                    
                    <h2><g:message code="riscos.tit.im" /></h2><span></span>
                    <table>
                        <tbody>
                        	<tr class="prop">
                        		<th valign="top">Escore</th>
                                <th valign="top">% Morte Intra-Hospitalar</th>
                                <th valign="top">% MI Intra-Hospitalar</th>
                                <th valign="top">% Morte 6 meses</th>
                                <th valign="top">% MI 6 meses</th>
                            </tr> 
                            	
	                     	<tr class="prop">
                                <td valign="top" class="name">
                                  <label for="graceMorteIntra"><g:message code="riscos.graceMorteIntra.label" default="GRACE" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: riscosInstance, field: 'graceMorteIntra', 'errors')}">
                                	<g:textField name="graceMorteIntra" value="${fieldValue(bean: riscosInstance, field: 'graceMorteIntra')}" />
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: riscosInstance, field: 'graceMIIntra', 'errors')}">
                                	<g:textField name="graceMIIntra" value="${fieldValue(bean: riscosInstance, field: 'graceMIIntra')}" />
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: riscosInstance, field: 'graceMorte6meses', 'errors')}">
                                	<g:textField name="graceMorte6meses" value="${fieldValue(bean: riscosInstance, field: 'graceMorte6meses')}" />
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: riscosInstance, field: 'graceMI6meses', 'errors')}">
                                	<g:textField name="graceMI6meses" value="${fieldValue(bean: riscosInstance, field: 'graceMI6meses')}" />
                                </td>
                            </tr>
                            
                         </tbody>
                    </table>

                    <h2><g:message code="riscos.tit.rs" /></h2>
                    <table>
                        <tbody>
                        
                        	<tr class="prop">
                                <th valign="top">Escore</th>
                                <th valign="top">Pontos</th>
                                <th valign="top">%</th>
                            </tr>
                            <g:if test="${RiscoCreatinina != [null]}" ><g:set var="RiscoGFR" value="${(140 - RiscoIdade) * RiscoPeso / (72 * RiscoCreatinina)}" /></g:if>
                            <g:else><g:set var="RiscoGFR" value="${121}" /></g:else>
                            
                            <g:if test="${RiscoHematocrito[0] >= 37.0 && RiscoHematocrito[0] <= 39.9}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 2}" /></g:if>
                            <g:if test="${RiscoHematocrito[0] >= 34.0 && RiscoHematocrito[0] <= 36.9}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 3}" /></g:if>
                            <g:if test="${RiscoHematocrito[0] >= 31.0 && RiscoHematocrito[0] <= 33.9}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 7}" /></g:if>
                            <g:if test="${RiscoHematocrito[0] < 31.0}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 9}" /></g:if>
                            
                            <g:if test="${RiscoGFR >= 91.0 && RiscoGFR <= 120.0}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 7}" /></g:if>
                            <g:if test="${RiscoGFR >= 61.0 && RiscoGFR <= 90.0}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 17}" /></g:if>
                            <g:if test="${RiscoGFR >= 31.0 && RiscoGFR <= 60.0}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 28}" /></g:if>
                            <g:if test="${RiscoGFR >= 16.0 && RiscoGFR <= 30.0}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 35}" /></g:if>
                            <g:if test="${RiscoGFR < 16.0}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 39}" /></g:if>
                            
                            <g:if test="${RiscoFC >= 71 && RiscoFC <= 80}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 1}" /></g:if>
                            <g:if test="${RiscoFC >= 81 && RiscoFC <= 90}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 3}" /></g:if>
                            <g:if test="${RiscoFC >= 91 && RiscoFC <= 100}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 6}" /></g:if>
                            <g:if test="${RiscoFC >= 101 && RiscoFC <= 110}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 8}" /></g:if>
                            <g:if test="${RiscoFC >= 111 && RiscoFC <= 120}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 10}" /></g:if>
                            <g:if test="${RiscoFC > 120}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 11}" /></g:if>
                            
                            <g:if test="${RiscoPAS < 91}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 9}" /></g:if>
                            <g:if test="${RiscoPAS >= 91 && RiscoPAS <= 100}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 7}" /></g:if>
                            <g:if test="${RiscoPAS >= 101 && RiscoPAS <= 120}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 4}" /></g:if>
                            <g:if test="${RiscoPAS >= 181 && RiscoPAS <= 200}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 2}" /></g:if>
                            <g:if test="${RiscoPAS > 200}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 4}" /></g:if>
                            
                            <g:if test="${RiscoDAP == [true]}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 6}" /></g:if>
                            
                            <g:if test="${RiscoDmi == [true] || RiscoDmii == [true]}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 6}" /></g:if>
                            
                            <g:if test="${RiscoKillip > 1}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 7}" /></g:if>
                            
                            <g:if test="${RiscoGenero.equals('Feminino')}" ><g:set var="RiscoPontosCrusade" value="${RiscoPontosCrusade + 8}" /></g:if>
                            
                            <g:if test="${RiscoPontosCrusade == 1}" ><g:set var="RiscoPorcentCrusade" value="${2.6}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 2}" ><g:set var="RiscoPorcentCrusade" value="${2.7}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 3}" ><g:set var="RiscoPorcentCrusade" value="${2.8}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 4}" ><g:set var="RiscoPorcentCrusade" value="${2.9}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 5}" ><g:set var="RiscoPorcentCrusade" value="${3.0}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 6}" ><g:set var="RiscoPorcentCrusade" value="${3.1}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 7}" ><g:set var="RiscoPorcentCrusade" value="${3.2}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 8}" ><g:set var="RiscoPorcentCrusade" value="${3.3}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 9}" ><g:set var="RiscoPorcentCrusade" value="${3.4}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 10}" ><g:set var="RiscoPorcentCrusade" value="${3.5}" /></g:if>
                             <g:if test="${RiscoPontosCrusade == 11}" ><g:set var="RiscoPorcentCrusade" value="${3.6}" /></g:if>
                             <g:if test="${RiscoPontosCrusade == 12}" ><g:set var="RiscoPorcentCrusade" value="${3.8}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 13}" ><g:set var="RiscoPorcentCrusade" value="${3.9}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 14}" ><g:set var="RiscoPorcentCrusade" value="${4.0}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 15}" ><g:set var="RiscoPorcentCrusade" value="${4.1}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 16}" ><g:set var="RiscoPorcentCrusade" value="${4.3}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 17}" ><g:set var="RiscoPorcentCrusade" value="${4.4}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 18}" ><g:set var="RiscoPorcentCrusade" value="${4.6}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 19}" ><g:set var="RiscoPorcentCrusade" value="${4.7}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 20}" ><g:set var="RiscoPorcentCrusade" value="${4.9}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 21}" ><g:set var="RiscoPorcentCrusade" value="${5.0}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 22}" ><g:set var="RiscoPorcentCrusade" value="${5.3}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 23}" ><g:set var="RiscoPorcentCrusade" value="${5.4}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 24}" ><g:set var="RiscoPorcentCrusade" value="${5.6}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 25}" ><g:set var="RiscoPorcentCrusade" value="${5.7}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 26}" ><g:set var="RiscoPorcentCrusade" value="${5.9}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 27}" ><g:set var="RiscoPorcentCrusade" value="${6.1}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 28}" ><g:set var="RiscoPorcentCrusade" value="${6.3}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 29}" ><g:set var="RiscoPorcentCrusade" value="${6.5}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 30}" ><g:set var="RiscoPorcentCrusade" value="${6.7}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 31}" ><g:set var="RiscoPorcentCrusade" value="${6.9}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 32}" ><g:set var="RiscoPorcentCrusade" value="${7.1}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 33}" ><g:set var="RiscoPorcentCrusade" value="${7.3}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 34}" ><g:set var="RiscoPorcentCrusade" value="${7.6}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 35}" ><g:set var="RiscoPorcentCrusade" value="${7.8}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 36}" ><g:set var="RiscoPorcentCrusade" value="${8.1}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 37}" ><g:set var="RiscoPorcentCrusade" value="${8.3}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 38}" ><g:set var="RiscoPorcentCrusade" value="${8.6}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 39}" ><g:set var="RiscoPorcentCrusade" value="${8.9}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 40}" ><g:set var="RiscoPorcentCrusade" value="${9.2}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 41}" ><g:set var="RiscoPorcentCrusade" value="${9.5}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 42}" ><g:set var="RiscoPorcentCrusade" value="${9.8}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 43}" ><g:set var="RiscoPorcentCrusade" value="${10.1}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 44}" ><g:set var="RiscoPorcentCrusade" value="${10.4}" /></g:if>                            
                            <g:if test="${RiscoPontosCrusade == 45}" ><g:set var="RiscoPorcentCrusade" value="${10.7}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 45}" ><g:set var="RiscoPorcentCrusade" value="${11.0}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 47}" ><g:set var="RiscoPorcentCrusade" value="${11.4}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 48}" ><g:set var="RiscoPorcentCrusade" value="${11.7}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 55}" ><g:set var="RiscoPorcentCrusade" value="${14.4}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 65}" ><g:set var="RiscoPorcentCrusade" value="${19.2}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 76}" ><g:set var="RiscoPorcentCrusade" value="${25.6}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 83}" ><g:set var="RiscoPorcentCrusade" value="${30.4}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 87}" ><g:set var="RiscoPorcentCrusade" value="${33.4}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 89}" ><g:set var="RiscoPorcentCrusade" value="${34.9}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 90}" ><g:set var="RiscoPorcentCrusade" value="${35.7}" /></g:if>
                            <g:if test="${RiscoPontosCrusade == 96}" ><g:set var="RiscoPorcentCrusade" value="${40.5}" /></g:if>
                            
                            
                       	 	<tr class="prop">
                                <td valign="top" class="name">
                                  <label for="crusadePontos"><g:message code="riscos.crusade.label" default="CRUSADE" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: riscosInstance, field: 'crusadePontos', 'errors')}">
                                    <g:textField name="crusadePontos" value="${RiscoPontosCrusade}" />
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: riscosInstance, field: 'crusadePerc', 'errors')}">
                                    <g:textField name="crusadePerc" value="${RiscoPorcentCrusade}" />
                                </td>
                            </tr>
                            
                        </tbody>
                    </table>
                </div>
                <g:if test="${riscosInstance.lastUpdated}">
	                <br>
	                <table width="100%">
	                	<tbody>
	                        <tr class="prop">
	                            <td valign="middle" class="name">Inserido por</td>
	                            <td valign="middle" class="value">
	                            	${riscosInstance?.createdBy?.nome} em <g:formatDate date="${riscosInstance?.dateCreated}" /></td>
	                            <td valign="middle" class="name">Atualizado por</td>
	                            <td valign="middle" class="value">
	                            	${riscosInstance?.updatedBy?.nome} em <g:formatDate date="${riscosInstance?.lastUpdated}" /></td>
	                        </tr>
	                    </tbody>
	               </table>
	               <br>
	               </g:if>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
